package com.hdu.other.dp.shuweiDp;

public class lc357 {
    class Solution {
        public int countNumbersWithUniqueDigits(int n) {
            if (n == 0) return 1;
            int ans = 10;
            for (int i = 2, a = 9, b = 9; i <= n; i++, b--)
            {
                a *= b;
                ans += a;
            }
            return ans;
        }
    }
}
